﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace EZCRS.HCMS.Entity
{
    public class HCRS_Plan
    {

        private int _id;
        private int _pid;

        private string _plancode;
        private string _roomcode;

        private string _planname;

        private string _roomname;

        private string _plandesc;

        private string _roomdesc;

        private string _type;

        private int _languagetype;
        private int _available;

        private DateTime? _updatetime;

        public HCRS_Plan(){}

        public HCRS_Plan(DataRow dr)
        {

            if (dr != null)
            {
                _available = 0;

                if (dr["id"].ToString() != "") _id = Convert.ToInt32(dr["id"].ToString());

                if (dr["Property_id"].ToString() != "") _pid = Convert.ToInt32(dr["Property_id"].ToString());

                if (!string.IsNullOrEmpty(dr["languagetype"].ToString())) 
                    _languagetype = Convert.ToInt32(dr["languagetype"].ToString());

                if (!string.IsNullOrEmpty(dr["available"].ToString())) 
                    _available = Convert.ToInt32(dr["available"].ToString());

                _plancode = dr["plancode"].ToString();
                _roomcode = dr["roomcode"].ToString();

                _planname = dr["planname"].ToString();
                _roomname = dr["roomname"].ToString();

                _plandesc = dr["plandesc"].ToString();
                _roomdesc = dr["roomdesc"].ToString();


                if (dr["updatetime"].ToString() != "") 
                    _updatetime = Convert.ToDateTime(dr["updatetime"].ToString());

            }
        }

        #region 公共属性

        [DataFieldAttribute("plancode")]
        public string PlanCode
        {
            get
            {
                return _plancode;
            }
            set
            {
                _plancode = value;
            }

        }


        /// <summary>
        /// 房间代码
        /// </summary>
        [DataFieldAttribute("RoomCode")]
        public string RoomCode
        {
            get
            {
                return _roomcode;
            }
            set
            {
                _roomcode = value;
            }

        }

        /// <summary>
        /// 计划名称
        /// </summary>
        [DataFieldAttribute("planname")]
        public string PlanName
        {
            get
            {
                return _planname;
            }
            set
            {
                _planname = value;
            }

        }

        /// <summary>
        /// 房间名称
        /// </summary>
        [DataFieldAttribute("roomname")]
        public string RoomName
        {
            get
            {
                return _roomname;
            }
            set
            {
                _roomname = value;
            }
        
        }


        /// <summary>
        /// ID
        /// </summary>
        [DataFieldAttribute("id", "pk")]
        public int ID
        {
            get { return _id; }
            set { _id = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        [DataFieldAttribute("Property_id")]
        public int Pid
        {
            get { return _pid; }
            set { _pid = value; }
        }

        [DataFieldAttribute("languagetype")]
        public int LanguageType
        {
            get { return _languagetype; }
            set { _languagetype = value; }
        }

        [DataFieldAttribute("available")]
        public int available
        {
            get { return _available; }
            set { _available = value; }
        }

        [DataFieldAttribute("plandesc")]
        public string PlanDesc
        {
            get { return _plandesc; }
            set { _plandesc = value; }
        }

        [DataFieldAttribute("roomdesc")]
        public string RoomDesc
        {
            get { return _roomdesc; }
            set { _roomdesc = value; }
        }

        [DataFieldAttribute("type")]
        public string Type
        {
            get { return _type; }
            set { _type = value; }
        }

        [DataFieldAttribute("updatetime")]
        public DateTime? updatetime
        {
            get { return _updatetime; }
            set { _updatetime = value; }
        }

        #endregion
    }
}
